<?php
class Third_Form_Input extends Third_Form_Pattern{

	public function __construct( $name , $options ){
		parent::__construct( $name , $options );
		$this->field = new Zend_Form_Element_Text( $this->name );
	}

	function setPattern( $pattern ) {
		$pattern = strtolower( $pattern );

		switch( $pattern ){
			case 'date':
				// $this->options['values'] = array("Sim"=>"S", "Nao"=>"N" );
				/*
				$values = Zend_Json::decode( $this->options['values'] );
				if(is_array( $values ))
					$this->field->addMultiOptions( $values );
				*/
				$date = new Zend_Date( Zend_Date::ISO_8601 );

				$elem = new ZendX_JQuery_Form_Element_DatePicker( $this->name );

				$elem->setJQueryParams(
					array(
						'altFormat'=> 'yy-mm-dd',
						'dateFormat' => 'dd/mm/yy'
					)
				);
				$this->field = $elem;
			break;
		}
	}
	// inscricoes_inicio
	
	public function get( $handle ){

		if( !$handle )
			$handle = $this->options['display'];
		else
			$handle = $this->options['editable'];
    		
    	if( $handle  == 'true' ){
    	    if( $this->options['pattern'] == 'birth' ){
    	        
    	        $this->field = new Third_Form_Date( $this->name);
    	        $this->field->addPrefixPath(
    	            'Third_Form',
    	        	'Third/Form/'
    	        );

    	        $this->field->setDecorators(array('FormDate'));
                Zend_Debug::dump( $this->field->render() );

    	        
    	        /*
    	        $this->field->setDecorators( array(
    'prefixPath' => array('decorator' => array(
        'FormDate' => 'Third/Form/Decorator/',
    )),
    'decorators' => array('formDate'),
)); */

    	        return $this->field;

                return $day->render();
                    	        
    	    } else {
    	        parent::get( $handle );
    	    }
    	}
	}
}
?>